/*
 *************************************************************************
 * @flie: system_call.c
 * @author: andy.chen
 * @data: 2020.11.18
 *************************************************************************
 */
#include "system_call.h"
#include "printf.h"

int sys_print()
{
	printf("sys_print\r\n");
	return 0;
}

int sys_exit(int i)
{
	printf("sys_exit:%d\r\n",i);
	return 0;
}

int sys_fork()
{
	return 0;
}

int sys_read()
{
	return 0;
}

int sys_write()
{
	return 0;
}

int sys_open()
{
	return 0;
}

int sys_close()
{
	return 0;
}

syscall_fn_ptr system_call_table[] = {
	sys_print,
	sys_exit,
	sys_fork,
	sys_read,
	sys_write,
	sys_open,
	sys_close,
};

int sys_call_schedule(unsigned int index,int num,int *args){
    if(system_call_table[index]){
        return (system_call_table[index])(num,args); 
    }

    return -1;
}

